<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>伸缩按钮</title>
    <style>
        body{
            height: 100vh;
        }
        .btn-container{
            width: 320px;
            height: 60px;
            outline: 1px solid red;
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%,-50%);

        }
        /* hover之前的状态 */
        .btn{
            width: 60px;
            height: 60px;
            border-radius: 50%;
            position: absolute;
            left: 0;
            top: 0;
            background-color: rgb(243, 145, 145);
            transition-duration: 1s;
            font-size: 1.5em;
            line-height: 60px;
            text-align: center;
            color: white;
        }
        /* .btn:nth-child(1){
            transition-delay: 0.5s;
        } */
        /* 设定元素过渡效果的延迟 */
        .btn:nth-child(2){
            transition-delay: 0.8s;
        }
        .btn:nth-child(3){
            transition-delay: 0.6s ;
        }
        .btn:nth-child(4){
            transition-delay:0.4s ;
        }
        .btn:nth-child(5){
            transition-delay: 0.2s;
        }
        .btn:nth-child(6){
            transition-delay: 0;
        }
        .btn:first-child{
            width: 100%;
            border-radius: 30px;
            background-color: rgb(94, 114, 103);
            z-index: 1;
        }
        /* hover之后的状态 */
        .btn-container:hover .btn:first-child{
            width: 60px;
        }
        .btn-container:hover .btn:nth-child(2){
            transform: translateX(64px) rotate(360deg);
        }
        .btn-container:hover .btn:nth-child(3){
            transform: translateX(128px) rotate(360deg);
        }
        .btn-container:hover .btn:nth-child(4){
            transform: translateX(192px) rotate(360deg);
        }
        .btn-container:hover .btn:nth-child(5){
            transform: translateX(256px) rotate(360deg);
        }
        .btn-container:hover .btn:nth-child(6){
            transform: translateX(320px) rotate(360deg);
        }
    </style>
</head>
<body>
    <div class="btn-container">
        <div class="btn">1</div>
        <div class="btn">2</div>
        <div class="btn">3</div>
        <div class="btn">4</div>
        <div class="btn">5</div>
        <div class="btn">6</div>
    </div>
</body>
</html>